package com.opener.web.spring.context;

import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ApplicationObjectSupport;
import org.springframework.stereotype.Component;

import javax.servlet.ServletContext;

/**
 * Created by baboy on 12/12/2016.
 */
@Component
public class AppContext extends ApplicationObjectSupport {
    private static ApplicationContext ctx;
    private static ApplicationContext dispatcher;
    private static ServletContext servletContext;
    private static AppContext instance;
    public AppContext(){
        super();
        instance = this;
    }
    public static ApplicationContext getRootContext(){
        return AppContextListener.getRootContext();
    }
    public static ApplicationContext getContext(){
        return instance.getApplicationContext();
    }
}
